package com.ruoyi.classai.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.ruoyi.classai.domain.AnalysisModeRel;
import com.ruoyi.classai.domain.EwcAnalysismodeRel;
import com.ruoyi.classai.domain.QueryAiMsg;
import com.ruoyi.classai.mapper.AnalysisModeRelMapper;
import com.ruoyi.classai.service.AnalysisModeRelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AnalysisModeRelServiceImpl extends ServiceImpl<AnalysisModeRelMapper, AnalysisModeRel> implements AnalysisModeRelService {
    @Autowired
    private AnalysisModeRelMapper analysisModeRelMapper;

    @Override
    public boolean updateByTaskId(AnalysisModeRel analysisModeRel) {
        UpdateWrapper<AnalysisModeRel> updateWrapper = new UpdateWrapper<>();
        updateWrapper.eq("task_id", analysisModeRel.getTask_id());

        return this.update(analysisModeRel, updateWrapper);
    }

    @Override
    public AnalysisModeRel getByTaskId(AnalysisModeRel analysisModeRel) {
        QueryWrapper<AnalysisModeRel> updateWrapper = new QueryWrapper<>();
        updateWrapper.eq("task_id", analysisModeRel.getTask_id());
        return this.getOne(updateWrapper);
    }

    @Override
    public QueryAiMsg queryAiMsg(AnalysisModeRel analysisModeRel) {

        return analysisModeRelMapper.queryAiMsg(analysisModeRel);
    }
}